<%@ page import="com.example.ordersystem.domain.LineitemInfo" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: 檬zhu
  Date: 2021/12/14
  Time: 13:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/resources/layui/css/layui.css">
</head>
<body>
<jsp:include page="title.jsp"/>

<%
    Object object = request.getAttribute("orderDetail");//获取当前顾客的所有订单项
    @SuppressWarnings("unchecked")
    List<LineitemInfo> items = (List<LineitemInfo>) object;
%>

<div style="margin-top: 3%;margin-left: 25%;width: 610px;height: 350px;overflow: auto">
    <table class="layui-table" style="width: 600px; float: left;">
        <thead>
        <tr>
            <th>菜品</th>
            <th>图片</th>
            <th>单价</th>
            <th>数量</th>
            <th>小计</th>
        </tr>
        </thead>
        <tbody>

        <%
            for (int i = 0; i < items.size(); ++i) {
        %>
        <tr>
            <td><%=items.get(i).getdName()%>
            </td>
            <td><img alt="" src="<%=items.get(i).getDisplayPicture()%>"></td>
            <td><%=items.get(i).getPrice()%>
            </td>
            <td><%=items.get(i).getQuantity()%>
            </td>
            <td><%=items.get(i).getAmount()%>
            </td>
                <%
            }
        %>
        </tbody>
    </table>
</div>
</body>
</html>
